<template>
  <div>
    <div class="heads">
      
      <div>
        <span v-if="$store.state.user" @click="logout">欢迎{{$store.state.user}}</span>
        <span v-else @click="login">立即登录</span>
      </div>
      <div>
        我的订单
      </div>
      <div @click="gocollect">
        我的收藏
      </div>
      <div style="background-color: #FF6700;" @click="gocate">
        购物车
      </div>
      <div></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
     
    };
  },
  methods: {
    gocate(){
      this.$router.push('/shopcar');
    },
    logout(){
      this.$store.commit('logout')
    },
    login(){
      this.$router.push('/login')
    },
    gocollect(){
      this.$router.push('/collect')
    }
  },
};
</script>

<style lang="scss" scoped>
.heads {
  height: 45px;
  background-color: #3d3d3d;
  color: #ccc;
  display: flex;
  justify-content: flex-end;
  div {
    // float: left;
    width: 200px;
    line-height: 45px;
    padding-left: 0;
  }
}
</style>
